package pers.jason.wppm.web.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pers.jason.wppm.api.entity.system.Menu;
import pers.jason.wppm.web.service.MenuService;
import pers.jason.wppm.web.dao.MenuDao;

import java.util.List;

/**
 * @ClassName: MenuServiceImpl
 * @Author: JZH
 * @Date: 2018/12/28 14:36
 */
@Service
public class MenuServiceImpl implements MenuService {

    @Autowired
    private MenuDao menuDao;


    @Override
    public List<Menu> getSystemMenu() {
        List<Menu> menuList = menuDao.getSystemMenu();
        for(Menu menu : menuList) {
            String roles = menuDao.getMenuRoles(menu.getId());
            menu.setRoles(roles);
        }
        return menuList;
    }
}
